<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>场景评分</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${path }/static/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${path }/static/css/public.css" media="all" />
</head>
<body class="childrenBody">

					<div class="layui-form-item" style="margin-top: 20px">
						<div id="senceRate" style="padding-left: 120px;"></div>
					</div>

	<script type="text/javascript" src="${path }/static/layui/layui.js"></script>
	<script>
	  layui.use(['rate'], function(){
		  var rate = layui.rate;
		  //基础效果
		  rate.render({
		    elem: '#senceRate'
		    ,value: parent.$("#score").val()
		    ,text: true
		    ,setText: function(value){ //自定义文本的回调
		        var arrs = {
		          '1': '极差'
		          ,'2': '差'
		          ,'3': '一般'
		          ,'4': '好'
		          ,'5': '极好'
		        };
		        this.span.text(arrs[value] || ( value + "星"));
		      }
		  ,choose: function(value){
			  parent.$.ajax({
	    			type : "POST",
	    			url : "../callRatio/grate",
	    			data : {
	    				"id" : parent.$("#grateId").val(),
	    				"score" : value
	    			},
	    			dataType : "json",
	    			success : function(jsonObject) {
	    	            top.layer.msg("完成评分！");
	    	            //刷新父页面
	    	           // parent.location.reload();
	    			}
	    		});
			  }
		  })
	  });
	</script>
</body>
</html>